package com.imooc.service;

import com.imooc.pojo.OrderStatus;
import com.imooc.pojo.Orders;
import com.imooc.vo.MyOrdersVO;
import com.imooc.vo.OrderStatusCountsVO;

import java.util.List;

/**
 * 订单 Service
 *
 * @author gcq
 * @Create 2022-01-08
 */
public interface MyOrderService {

    /**
     * 根据 userId 和 orderStatus 查询用户订单
     *
     * @param userId
     * @param orderStatus
     * @return
     */
    public List<MyOrdersVO> queryMyOrder(String userId, Integer orderStatus);

    /**
     * 更新订单状态为已发货
     *
     * @param orderId
     */
    public void updateDeliverOrderStatus(String orderId);

    /**
     * 根据 userId orderId 查询订单对象
     *
     * @param userId
     * @param orderId
     * @return
     */
    public Orders queryMyOrder(String userId, String orderId);

    /**
     * 根据 orderId 更新订单状态为确认收货
     * @param orderId
     * @return
     */
    public boolean updateReceiveOrderStatus(String orderId);

    /**
     * 根据 orderId userId 删除订单
     * @param orderId 订单 Id
     * @param userId 用户Id
     * @return 结果
     */
    public boolean deleteOrder(String orderId, String userId);


    /**
     * 根据 userId 查询订单数量
     * @param userId
     */
    public OrderStatusCountsVO getOrderStatusCounts(String userId);

    /**
     * 获取我的订单趋势
     * @param userId
     * @return
     */
    public List<OrderStatus> getMyOrderTrend(String userId);
}
